AttributeError: 'NoneType' object has no attribute 'save' | Pillow